﻿@using PWDManage.Model.OtherClass

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";

    List<NBAScdule> nbaResult = ViewBag.NBASCD == null ? new List<NBAScdule>() : ViewBag.NBASCD;
}

<link href="css/nba.css" rel="stylesheet" type="text/css" />

<div class="stream" style="min-height:1000px;">
    @if (nbaResult.Count > 0)
    {
        foreach (NBAScdule scdule in nbaResult)
        {
            int num = 0;
            <div class="item">
                @if (Convert.ToDateTime(scdule.list[0].startTime).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
                {
                    <div class="today">@scdule.date</div>
                }
                else
                {
                    <div class="date">@scdule.date</div>
                }
                <div class="list-time">
                    <div class="row">
                        <div class="time">时间</div>
                        <div class="status">状态</div>
                        <div class="visit">客队</div>
                        <div class="goal">比分</div>
                        <div class="home">主队</div>
                    </div>
                    @foreach (NbaResult item in scdule.list)
                    {
                        if (num % 2 == 0)
                        {
                            <div class="row left-win odd">
                                <div class="time">
                                    @Convert.ToDateTime(item.startTime).ToString("HH:mm")
                                    <span class="vip">@(item.isPay == "1" ? "会员" : "")</span>
                                </div>
                                @if (item.matchPeriod == "0")
                                {
                                    <div class="status">
                                     未开始
                                    </div>
                                }
                                @if (item.matchPeriod == "1")
                                {
                                    <div class="status">
                                        @item.quarter
                                    </div>
                                }
                                @if (item.matchPeriod == "2")
                                {
                                    <div class="status">
                                        已结束
                                    </div>
                                }
                                <div class="visit">
                                    <a href="javascrupt:void(0);">
                                        <span class="chname">@item.leftName</span>
                                        <img src="@item.leftBadge" class="logo" />
                                    </a>
                                </div>
                                <div class="goal">
                                    <span class="visit">@item.leftGoal</span>
                                    <span>-</span>
                                    <span class="home">@item.rightGoal</span>
                                </div>
                                <div class="home">
                                    <a href="javascript:void(0);">
                                        <span class="chname">@item.rightName</span>
                                        <img src="@item.rightBadge" class="logo" />
                                    </a>
                                </div>
                            </div>
                        }
                        else
                        {
                            <div class="row left-win even">
                                <div class="time">
                                    @Convert.ToDateTime(item.startTime).ToString("HH:mm");
                                    <span class="vip">@(item.isPay == "1" ? "会员" : "")</span>
                                </div>
                                @if (item.matchPeriod == "0")
                                {
                                    <div class="status">
                                        未开始
                                    </div>
                                }
                                @if (item.matchPeriod == "1")
                                {
                                    <div class="status">
                                        @item.quarter
                                    </div>
                                }
                                @if (item.matchPeriod == "2")
                                {
                                    <div class="status">
                                        已结束
                                    </div>
                                }
                                <div class="visit">
                                    <a href="javascrupt:void(0);">
                                        <span class="chname">@item.leftName</span>
                                        <img src="@item.leftBadge" class="logo" />
                                    </a>
                                </div>
                                <div class="goal">
                                    <span class="visit">@item.leftGoal</span>
                                    <span>-</span>
                                    <span class="home">@item.rightGoal</span>
                                </div>
                                <div class="home">
                                    <a href="javascript:void(0);">
                                        <span class="chname">@item.rightName</span>
                                        <img src="@item.rightBadge" class="logo" />
                                    </a>
                                </div>
                            </div>
                        }
                    }
                </div>
            </div>
        }
    }
  
</div>

